// 组织架构
import request from '@/utils/request'

// 新增部门

export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 查询企业部门列表

export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 根据ID修改部门详情

export function delDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据ID删除部门

export function delByDepart(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

// 根据ID查询部门详情

export function getByDepart(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
